BeginMediaEdits
TheBeginMediaEdits
function starts a media-editing session.
pascal OSErr BeginMediaEdits (Media theMedia);
theMedia
- Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as
NewTrackMedia
andGetTrackMedia
(described on page 2-138 and page 2-190, respectively).DESCRIPTION
You use theBeginMediaEdits
function to notify the Movie Toolbox that you are going to add sample data to a media. In response, the Movie Toolbox determines whether the media can be updated. For example, if the media data are stored on disk, the Movie Toolbox opens the disk file with write permissions. If the media is stored on a read-only storage medium, such as a CD-ROM disc, the Movie Toolbox does not start an editing session and returns an error.Use the
EndMediaEdits
function, which is described in the next section, to end a media-editing session.You must call
BeginMediaEdits
before you add samples to a media with theAddMediaSample
function (described on page 2-256). Under some circumstances, you must start a media-editing session before calling theInsertTrackSegment
function (described on page 2-246).ERROR CODES
File system errors
invalidMedia -2008 This media is corrupted or invalid